package com.copc.common.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.util.Date;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * @Author liubo
 * @Date 2022-10-31 15:42
 */
@Getter
@Setter
public class BaseEntity implements Serializable {

    /**
     * 主键id
     */
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private Long id;

    /** 创建者 */
    @NotBlank(message = "创建者不能为空")
    @ApiModelProperty(value = "创建者", required =  true )
    private String createdBy;

    /** 创建时间 */
    @NotNull(message = "创建时间不能为空")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @ApiModelProperty(value = "创建时间", required =  true )
    private Date createdTime;

    /** 更新者 */
    @NotBlank(message = "更新者不能为空")
    @ApiModelProperty(value = "更新者", required =  true )
    private String updatedBy;

    /** 更新时间 */
    @NotNull(message = "更新时间不能为空")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @ApiModelProperty(value = "更新时间", required =  true )
    private Date updatedTime;


//    /**
//     * 是否删除[0:未删除,1:删除]
//     */
//    @TableLogic(delval = "1",value = "0")
//    private Integer deleted;


}
